Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add toggle to show only changed columns in experiments table #4402

Merged
merged 9 commits into from
Aug 2, 2023

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Aug 2, 2023

Revisited whilst looking at #4229

Closes #1994

This PR gives users the ability to switch the experiments table into a show-only changed columns mode. The behaviour closely follows the --only-changed flag for exp show (documented here):

image

Demo

Screen.Recording.2023-08-02.at.12.36.23.pm.mov

@mattseddon mattseddon added the product PR that affects product label Aug 2, 2023
@mattseddon mattseddon self-assigned this Aug 2, 2023
private getWebviewData(): TableData {
const filters = this.experiments.getFilters()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[I] Follow up by making all of this async

@mattseddon mattseddon marked this pull request as ready for review August 2, 2023 05:23
@mattseddon mattseddon requested a review from shcheklein August 2, 2023 05:23
<div>
<p>No Columns Selected.</p>
<StartButton onClick={selectColumns} text="Add Columns" />
{showOnlyChanged && (
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[F] Good thing I remembered this because without it users would have been stuck.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen.Recording.2023-08-02.at.6.59.20.pm.mov

Copy link
Contributor

@julieg18 julieg18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@@ -210,6 +210,14 @@ $badge-size: 0.85rem;
}
}

.onlyChanged {
background-color: $indicator-badge-background;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, the hover color seems a little weird for the selected icon. I expected a lighter or darker shade, but instead you see a completely different color in most cases.

Maybe we could borrow a primary button's color and hover color for the "checked" only-changed icon 🤔

Copy link
Member Author

@mattseddon mattseddon Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL at the update. We I can followup if needed.

tooltipContent="Toggle Show Only Changed Columns"
delay={[1000, 0]}
>
<button
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we're basically adding a new feature instead of building off of selected columns? Aka, "Show Only Changed" selects only changed columns and deselects none-changed columns?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also a possibility of users being confused on why "selected" columns just aren't showing up in the table and assume something is broken 🤔

Copy link
Member Author

@mattseddon mattseddon Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we're basically adding a new feature instead of building off of selected columns? Aka, "Show Only Changed" selects only changed columns and deselects none-changed columns?

Here is a list of things to consider with the approach of building on top of selecting columns

  1. User takes a long time setting up mono-repo only to display the columns related to the project they are working in. Toggles show only changed - all selection is lost.
  2. What happens when show only changed is toggled off? Would we hold the previous state and return to that? Does the selection stay the same when show only changed is turned off?
  3. What happens when selection has changed when only changed is turned on? After applying only changed I deselect a number of columns. What happens when the data updates? Do these columns reappear? Can other new changed columns appear/get selected?
  4. Filtering can update the columns selected for show only changed. Would this also change the selection?

There's also a possibility of users being confused on why "selected" columns just aren't showing up in the table and assume something is broken 🤔

This is why I tried to make the indicator as obvious as possible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so tl;dr - it gets complicated fast. We can discuss tomorrow when we catch up.

appearance="secondary"
isNested={true}
onClick={toggleShowOnlyChanged}
text="Show Only Changed"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor! The "X" does make it more clear but when I saw this I assumed that only changed was off since the text is "Show Only Changed". Maybe "Disable Only Changed", Turn Off Only Changed" or "Toggle Only Changed"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to "Disable".

@mattseddon mattseddon enabled auto-merge (squash) August 2, 2023 22:25
@codeclimate
Copy link

codeclimate bot commented Aug 2, 2023

Code Climate has analyzed commit 6ba80a4 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (85% is the threshold).

This pull request will bring the total coverage in the repository to 95.2% (0.0% change).

View more on Code Climate.

@mattseddon mattseddon merged commit d672c12 into main Aug 2, 2023
@mattseddon mattseddon deleted the show-only-changed branch August 2, 2023 22:37
@BradyJ27
Copy link
Contributor

BradyJ27 commented Aug 7, 2023

Thanks for this! @mattseddon One small thing I noticed was when using the "show only changed" setting, the "columns" tab on the left no longer works to filter out columns. I wasn't sure if this was a limitation or a bug.

@mattseddon
Copy link
Member Author

@BradyJ27 show only changed is an overlay on top of the selected columns. It automatically hides unchanged columns that are selected but does not change the selected state of the columns. De-selecting columns that are still visible is possible:

Screen.Recording.2023-08-08.at.7.55.46.am.mov

See #4402 (comment) above for more details on why this implementation was chosen.

@BradyJ27
Copy link
Contributor

BradyJ27 commented Aug 8, 2023

@BradyJ27 show only changed is an overlay on top of the selected columns. It automatically hides unchanged columns that are selected but does not change the selected state of the columns. De-selecting columns that are still visible is possible:

Screen.Recording.2023-08-08.at.7.55.46.am.mov
See #4402 (comment) above for more details on why this implementation was chosen.

Sure, this makes sense. The columns tab will still show all columns, but selecting/de-selecting hidden columns does nothing when the "toggle only changed" is on. Thanks for clarifying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR that affects product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only show relevant columns in experiments table
3 participants